﻿using ReflectionStudio.Components.UserControls;
using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace WPFExcelReport
{
    public partial class MainWindow
    {
        VSDDAT vm;
        public MainWindow()
        {
            vm = new VSDDAT();
            DataContext = vm;
            InitializeComponent(); 
            Name = "关键字管理";

        }
        ViewBase ui;
        public override void OnWorkflowIDChange(MessageEventArgs e)
        {
            base.OnWorkflowIDChange(e);
            MessageInfo msg = e.Info;
            string wid = msg.Details;
            switch (wid)
            {
                case "TSD02": 
                    ui = new TSDDAT();                    
                    ((TSDDAT)ui).SDSA = msg.KRS;
                    ((TSDDAT)ui).SetUp();
                    MainTab.Children.Add(ui);
                    break;
                case "CTYP":
                    ui = new TYCTYP();
                    ((TYCTYP)ui).SDSA = msg.KRS;
                    ((TYCTYP)ui).TMV.SetUp();
                    MainTab.Children.Add(ui);
                    break;
                case "ERK":
                    ui = new TERK();
                    ((TERK)ui).SDSA = msg.KRS;
                    ((TERK)ui).SetUp();
                    MainTab.Children.Add(ui);
                    break; 
            }
        } 
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
             

        }

    }
}
